//
//  JiLuTVCell.m
//  HxgProject
//
//  Created by hxg on 2018/4/1.
//  Copyright © 2018年 XMYY-19. All rights reserved.
//

#import "JiLuTVCell.h"
#import "UILabel+Extention.h"

@implementation JiLuTVCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        [self setUpUI];
    }
    return self;
}


- (void)setUpUI
{
    UILabel *tempApplyZhouQiLbl = [[UILabel alloc] init];
    [tempApplyZhouQiLbl setCustomTitle:@"申请周期:"
                       textColor:defaultFontColor
                            font:cellTitleFont];
    [self.contentView addSubview:tempApplyZhouQiLbl];
    
    UILabel *tempApplyTimeLbl = [[UILabel alloc] init];
    [tempApplyTimeLbl setCustomTitle:@"申请时间:"
                           textColor:defaultFontColor
                                font:cellTitleFont];
    [self.contentView addSubview:tempApplyTimeLbl];
    [tempApplyZhouQiLbl makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(15.0f);
        make.top.equalTo(self.contentView.mas_top).offset(10.0f);
    }];
    
    [tempApplyTimeLbl makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(tempApplyZhouQiLbl.mas_left);
        make.top.equalTo(tempApplyZhouQiLbl.mas_bottom).offset(15.0f);
    }];
    
    self.applyZhouqiLbl = [[UILabel alloc] init];
    [self.applyZhouqiLbl setCustomTitle:@""
                              textColor:defaultFontColor
                                   font:cellTitleFont];
    [self.contentView addSubview:self.applyZhouqiLbl];
    [self.applyZhouqiLbl makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(tempApplyZhouQiLbl.mas_right).offset(3.0f);
        make.centerY.equalTo(tempApplyZhouQiLbl.mas_centerY);
    }];
    
    self.applyTimeLbl = [[UILabel alloc] init];
    [self.applyTimeLbl setCustomTitle:@""
                            textColor:defaultFontColor
                                 font:cellTitleFont];
    self.applyTimeLbl.numberOfLines = 2;
    [self.contentView addSubview:self.applyTimeLbl];
    [self.applyTimeLbl makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(tempApplyTimeLbl.mas_right).offset(3.0f);
        make.centerY.equalTo(tempApplyTimeLbl.mas_centerY);
        make.width.mas_equalTo(150.0f);
    }];
    
#pragma mark - 当前状态、申请金额
    UILabel *tempCurStateLbl = [[UILabel alloc] init];
    [tempCurStateLbl setCustomTitle:@"当前状态"
                          textColor:defaultFontColor
                               font:cellTitleFont];
    [self.contentView addSubview:tempCurStateLbl];
    [tempCurStateLbl makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(tempApplyZhouQiLbl.mas_centerY);
        make.left.equalTo(self.contentView.mas_centerX).offset(20.0f);
    }];
    
    self.curStateLbl = [[UILabel alloc] init];
    [self.curStateLbl setCustomTitle:@""
                           textColor:defaultFontColor
                                font:[UIFont fontWithName:@"PingFangSC-Regular" size:24.0f]];
    self.curStateLbl.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:self.curStateLbl];
    [self.curStateLbl makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(tempApplyTimeLbl.mas_centerY);
        make.right.equalTo(tempCurStateLbl.mas_right);
    }];
    
    UILabel *tempApplyNumLbl = [[UILabel alloc] init];
    [tempApplyNumLbl setCustomTitle:@"申请套餐"
                          textColor:defaultFontColor
                               font:cellTitleFont];
    [self.contentView addSubview:tempApplyNumLbl];
    [tempApplyNumLbl makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(tempCurStateLbl.mas_centerY);
        make.left.equalTo(tempCurStateLbl.mas_right).offset(20.0f);
    }];
    
    self.applyNumLbl = [[UILabel alloc] init];
    [self.applyNumLbl setCustomTitle:@""
                           textColor:kCommonBtnBgColor
                                font:[UIFont fontWithName:@"PingFangSC-Regular" size:28.0f]];
    self.applyNumLbl.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:self.applyNumLbl];
    [self.applyNumLbl makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.curStateLbl.mas_centerY);
        make.left.equalTo(tempApplyNumLbl.mas_left);
    }];
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
